﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>发送QQ消息</title>
<script src="../../../../js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="../../../../js/cookie.js" type="text/javascript"></script>

	<script type="text/javascript">
		function send(){
			document.getElementById('emailProcessing').innerHTML = '发送中...';
			var qq=document.getElementById('qq').value;
			var pwd=document.getElementById('pwd').value;
			var msg=document.getElementById('msg').value;
			//var target=document.getElementById('target').value;之后待用，增加target参数增加发送人
			 $.ajax({
				type:"POST", 
				async:false, 
				cache:false, 
				url: 'sendQQMsg.php' ,
				data:{qq:qq,pwd:pwd,msg:msg},   
				success:function(msg)// 
				{     // 如果提交成功可以在这进行一些后续操作  
					alert(msg);
					document.getElementById('emailProcessing').innerHTML = msg;
					if(msg.length==2&&msg.indexOf('1')==1){
							alert("发送成功");
							 location.reload();
					}else if(msg.length==2&&msg.indexOf('2')==2){
							alert('账号或者密码错误');
							
					}else{
						alert('发送失败');
					}
				}   
			 }); 
		}
	</script>
</head>
<body>
	
		 <label for="subject" >QQ:</label><br/>
         <textarea id="qq" name="qq" rows="1" cols="30"></textarea>
		 <br/>
        <label for="body" >密码:</label><br/>
       
		<input type="password" id='pwd' name="pwd"><br>
		<br/>
		<label for="body" >Message:</label><br/>
        <textarea id="msg" name="msg" rows="1" cols="30"></textarea>
	   <br/>
	   <input type="button" name="send" value="send" onClick="send()"/>
	   <br/>
	   <div id="emailProcessing"></div>
	

</body>
</html>
